import { getTravel } from "@/utils/api";

//旅游
const travel = {
  namespaced: true,
  state: () => ({
    travelMainList: [], //主数据
  }),
  actions: {
    //获取旅游主数据
    async travelData({ commit }) {
      let res = await getTravel();
      commit("travelDatas", res.data);
    },
  },
  mutations: {
    //获得并存储旅游主数据
    travelDatas(state, payload) {
      state.travelMainList = payload;
    },
  },
};

export default travel;
